package com.ruoyi.project.inspection.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.inspection.domain.VehicleImg;
import com.ruoyi.project.inspection.mapper.VehicleImgMapper;
import com.ruoyi.project.inspection.service.IVehicleImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车辆行驶证图片Service业务层处理
 *
 * @author ruoyi
 * @date 2020-07-13
 */
@Service
public class VehicleImgServiceImpl implements IVehicleImgService {
    @Autowired
    private VehicleImgMapper vehicleImgMapper;

    /**
     * 查询车辆行驶证图片
     *
     * @param id 车辆行驶证图片ID
     * @return 车辆行驶证图片
     */
    @Override
    public VehicleImg selectVehicleImgById(Long id) {
        return vehicleImgMapper.selectVehicleImgById(id);
    }

    /**
     * 查询车辆行驶证图片列表
     *
     * @param vehicleImg 车辆行驶证图片
     * @return 车辆行驶证图片
     */
    @Override
    public List<VehicleImg> selectVehicleImgList(VehicleImg vehicleImg) {
        return vehicleImgMapper.selectVehicleImgList(vehicleImg);
    }

    /**
     * 新增车辆行驶证图片
     *
     * @param vehicleImg 车辆行驶证图片
     * @return 结果
     */
    @Override
    public int insertVehicleImg(VehicleImg vehicleImg) {
        vehicleImg.setCreateTime(DateUtils.getNowDate());
        return vehicleImgMapper.insertVehicleImg(vehicleImg);
    }

    /**
     * 修改车辆行驶证图片
     *
     * @param vehicleImg 车辆行驶证图片
     * @return 结果
     */
    @Override
    public int updateVehicleImg(VehicleImg vehicleImg) {
        return vehicleImgMapper.updateVehicleImg(vehicleImg);
    }

    /**
     * 批量删除车辆行驶证图片
     *
     * @param ids 需要删除的车辆行驶证图片ID
     * @return 结果
     */
    @Override
    public int deleteVehicleImgByIds(Long[] ids) {
        return vehicleImgMapper.deleteVehicleImgByIds(ids);
    }

    /**
     * 删除车辆行驶证图片信息
     *
     * @param id 车辆行驶证图片ID
     * @return 结果
     */
    @Override
    public int deleteVehicleImgById(Long id) {
        return vehicleImgMapper.deleteVehicleImgById(id);
    }
}
